<?php
require_once APP_PATH . '/app/models/UserModel.php';

class IndexController extends BaseController {

    public function indexAction() {
        //echo "hehe\n";
        if ($this->session_timeout) {
            $this->response->redirect('timeout/index');
        } else {
            $param = array('phone' => $this->session->get("user"));
            $userModel = new UserModel;
            $info = $userModel->getInfo($param);
            if ($info) {
                $this->view->setVar("uid", $info['uid']);
                $this->view->setVar("userName", $info['username']);
                $this->view->setVar("authority", $info['authority']);
            }
            $this->view->enable();
        }
    }

}
